﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CostingList.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
    <style type="text/css">
    .key 
    {
        width: 90px !important;
        }
    .row {
         border-bottom:1px solid #E9E9E9;
         }
    </style>

    <script type="text/javascript">
     function doOpenCosting(ExtID,CustID)
    {    
	    var tid= getUrlVars()['tid'];                  
        url = "CostingDetail.aspx?view=0&CustID=" + CustID+"&ExtID="+ExtID;
        window.open(url,'CostingDetail','width=800,height=600,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
    }
     function doOpenCostAccounting(OfferPriceID,CustID)
    {    
	    var tid= getUrlVars()['tid'];                  
        url = "CostAccounting.aspx?CustID=" + CustID+"&oPriceId="+OfferPriceID;
        //window.open(url,'CostingDetail','width=800,height=600,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
        var win=window.open(url, '_blank');
        win.focus();
    }
      function doDelete(OPriceID,CustID)
    {   
        var vnpage = getUrlVars()["page_number"]; 
	    if (confirm('Bạn có thực sự muốn xóa?' ))
	    {                           
                if(vnpage)
                    window.location.href = "CostingList.aspx?action=delete&OPriceID=" + OPriceID+"&CustID="+CustID+"&page_number=" + vnpage;
                else
                   window.location.href = "CostingList.aspx?action=delete&OPriceID=" + OPriceID+"&CustID="+CustID;
        }
    }
       function doCostingInvoced(OPriceID,CustID)
    {   
        var vnpage = getUrlVars()["page_number"]; 
	    if (confirm('Bạn có thực sự muốn thực hiện chức năng này?' ))
	    {                           
                if(vnpage)
                    window.location.href = "CostingList.aspx?action=invoiced&OPriceID=" + OPriceID+"&CustID="+CustID+"&page_number=" + vnpage;
                else
                   window.location.href = "CostingList.aspx?action=invoiced&OPriceID=" + OPriceID+"&CustID="+CustID;
        }
    }
    jQuery("document").ready(function(){              
       jQuery("#txtCostNoSearch").blur(function () {  
              jQuery.ajax({
                   type: "POST",
                   url: "AjaxFile/GetCostNo.ashx",
                   success: function(msg){                                                                                             
                   var arrSource=msg.split(",");                                       
                   $('#txtCostNoSearch').autocomplete(arrSource);  
                   }                               
              });                                                                       
         }).blur();   
         
          $('#txtCostNoSearch').keyup(function(event) {          
              if (event.keyCode == 13 || event.keyCode==9) {              
                 $("#btnSearch").click();
              } else {              
                return true;
              }
            }); 
    });
    </script>

</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                SALE COSTING</h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmEdit" runat="server" method="post">
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">
                            Costing No:
                        </h3>
                        <div id="action_button">                            
                            <asp:TextBox class="cls" ID="txtCostNoSearch" runat="server" Width="150px" value=""
                                Style="margin: 9px 10px;"></asp:TextBox>
                            <asp:Button class="button" ID="btnSearch" runat="server" Text="Serch" OnClick="btnSearch_Click"
                                Style="display: none;" />
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <fieldset>
                        <asp:Repeater ID="rptCostingList" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "CostNo")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "CostContainer")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "CostBuy")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "CostSell")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "CostInv")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "Update")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "Status")%>
                                    </td>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                                    <thead>
                                        <tr>
                                            <th align="center" class="thheader" width="30px">
                                                Stt</th>
                                            <th align="center" class="thheader" width="150px">
                                                Cost No.</th>
                                            <th align="center" class="thheader" width="150px">
                                                40'RF</th>
                                            <th align="center" class="thheader" width="150px">
                                                3500</th>
                                            <th align="center" class="thheader" width="150px">
                                                3550</th>
                                            <th align="center" class="thheader" width="150px">
                                                3600</th>
                                            <th align="center" class="thheader" width="150px">
                                                Update</th>
                                            <th align="center" class="thheader" width="150px">
                                                Status</th>
                                            <th align="center" class="thheader" width="100px">
                                                Action</th>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                    </fieldset>
                    <div class="clear">
                    </div>
                </form>
            </div>
            <div id="footer">
                <%=strPager%>
            </div>
        </div>
    </div>
</body>
</html>
